
package org.icnmasjid.member.dao;

import java.util.List;

import org.icnmasjid.member.dao.Dao;
import org.icnmasjid.member.model.Person;
import org.icnmasjid.member.model.Role;
import org.icnmasjid.member.model.SubOrg;

public interface PersonDao extends Dao {

    /**
     * Retrieves all of the persons
     */
    public List getPersons(Person person);

    public List getPersonsbyExample(final Person person);

    /**
     * Gets person's information based on primary key. An
     * ObjectRetrievalFailureException Runtime Exception is thrown if
     * nothing is found.
     *
     * @param personId the person's personId
     * @return person populated person object
     */
    public Person getPerson(final Integer personId);

    /**
     * Saves a person's information
     * @param person the object to be saved
     */
    public void savePerson(Person person);

    /**
     * Removes a person from the database by personId
     * @param personId the person's personId
     */
    public void removePerson(final Integer personId);

    public Person getPersonByEmail(String email);

    public List<Person> getPersons(
            Person person,
            String sortCriteria,
            String direction,
            Integer pageNumber,
            Integer numberOfResultsPerPage
    );

    public int getPersonsCount(
 	       Person person
    );

    public List<Person> getPersonsWithEmail();
    
    public List<Person> getParentsWithEmail(Role schoolYearRole);
    
    public List<Person> getParents(SubOrg grade, Role year);
    
    public List<Person> getPersons(List<String> emails, List<String> numbers);
    
    public Long getGradeCount(String grade1, String roleName);
    
    public List<Person> getPrimaryPersonsWithEmail();   
    
    public Person getLoadedPerson(Integer personId);
}

